-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change default naming to not include release name #119
Change default naming to not include release name #119
Conversation
f836186
to
d38c2ef
Compare
d38c2ef
to
7580133
Compare
{{- /* | ||
Common labels | ||
*/}} | ||
{{- define "binderhub-service.labels" -}} | ||
helm.sh/chart: {{ printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{ include "binderhub-service.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end }} | ||
|
||
{{- /* | ||
Selector labels | ||
*/}} | ||
{{- define "binderhub-service.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ .Values.nameOverride | default .Chart.Name | trunc 63 | trimSuffix "-" }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I relocated these to a dedicated file to keep track of what helper functions was related to: labels, names, and other misc things.
I did a delayed self-review, and is now moving ahead merging this based on #57 (comment) where I'll followup with testing it practically by doing 2i2c-org/infrastructure#4370 |
This makes for briefer resource names, while preserving the ability to deploy multiple instances in the same namespace. It also systematically introduces helper functions rendering various resource names, which is useful if a parent chart wants to reference them. Overall, this PR is making this chart align with how the jupyterhub chart behaves.
Naming changes
Breaking changes
Anything referencing these names will experiencing a breaking change, but if that isn't done, it may be fine to upgrade because there isn't a PV resource or similar being renamed that leads to data loss.
There is no way to exactly retain the existing naming as part of this change.
During upgrade when using an Ingress resource with ingress-nginx, you may run into an error like:
To handle that, just delete the old ingress resource first manually by
kubectl delete ingress ...
.Related docs
The jupyterhub chart has related docs on fullnameOverride.